﻿using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace TestGame {
    class Particle {
        private Vector2 currentPosition;
        private I_Path path;

        private static Texture2D smallParticularTexture;
        private static Texture2D largeParticularTexture;

        public Particle(Vector2 position, I_Path path) {
            currentPosition = position;
            this.path = path;
        }

        public void Update(GameTime gameTime) {
            if (!path.HasReachedEnd()) {
                currentPosition = path.CalculatePosition(currentPosition, gameTime.ElapsedGameTime);
            }
        }

        public bool HasFinished() {
            return path.HasReachedEnd();
        }

        public static void LoadContent(ContentManager content) {
            smallParticularTexture = content.Load<Texture2D>("particleSmallStar");
            largeParticularTexture = content.Load<Texture2D>("particleStar");
        }

        public void Draw(SpriteBatch spriteBatch, ContentManager content) {
            spriteBatch.Draw(smallParticularTexture, currentPosition, Color.White);
        }
    }
}
